<!doctype html>
<html>
<head>
  <title>The Gopher Network</title>

  <link type="text/css" rel="stylesheet" href="/static/style.css" />

  <!-- See https://github.com/firebase/firebaseui-web. -->
  <!-- *******************************************************************************************
       * TODO(DEVELOPER): Paste the initialization snippet from:
       * http://console.firebase.google.com > Overview > Add Firebase to your web app.
       ***************************************************************************************** -->
  <script>
    if (typeof firebase === 'undefined') {
      const msg = "Please paste the Firebase initialization snippet into index.html. See https://console.firebase.google.com > Overview > Add Firebase to your web app.";
      console.log(msg);
      alert(msg);
    }
  </script>
  <!-- [START gae_go_env_include_firebaseui] -->
  <script src="https://cdn.firebase.com/libs/firebaseui/2.6.2/firebaseui.js"></script>
  <link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/2.6.2/firebaseui.css" />
  <!-- [END gae_go_env_include_firebaseui] -->
  <!-- [START gae_go_env_index_js] -->
  <script src="/static/index.js"></script>
  <!-- [END gae_go_env_index_js] -->
</head>
<body>

<h1>The Gopher Network</h1>

<img id="logo" src="/static/gcp-gopher.svg" width="100">

<!-- [START gae_go_env_firebase_container] -->
<div id="firebaseui-auth-container"></div>
<!-- [END gae_go_env_firebase_container] -->

<!-- [START gae_go_env_signin_status] -->
<div id="sign-in"></div>
<div>
  <span id="account-details"></span>
  <button id="sign-out" hidden=true>Sign Out</button>
</div>
<!-- [END gae_go_env_signin_status] -->

{{with .Notice}}<div id="notice">{{.}}</div>{{end}}

<!-- [START gae_go_env_token_input] -->
<form id="post-form" action="/" method="post" hidden=true>
  <div>Message: <input name="message" value="{{.Message}}"></div>
  <input type="hidden" name="token" id="token">
  <input type="submit">
</form>
<!-- [END gae_go_env_token_input] -->

{{with .Posts}}
<ol>
  {{range .}}
  <li><cite>{{.Author}}</cite><p>{{.Message}}</p></li>
  {{end}}
</ol>
{{end}}

</body>
</html>
